How many characters s currently holds - up to its own declared capacity, never more.
string_length(s) -> int| Name | Type |
|---|---|
s | string |
int
How many characters s currently holds - up to its own declared capacity (§2.3.1's string type: bounded text, 64 characters by default in a new project, raised or lowered per variable with a /// @capacity doc tag).
var name = "Ada";
var empty = "";
var longer = string_length(name) > string_length(empty);string_length never counts past what s actually holds right now - a string that was built with string_slice/string_trim/etc. and came out shorter than its own capacity reports the shorter length, not the capacity.